package com.neutech.maplestory.entity;

import com.neutech.maplestory.client.MapleStoryClient;
import com.neutech.maplestory.util.ImageUtil;
import com.sun.deploy.security.MSCredentialManager;

import java.awt.*;

/**
 * @author ZZQ
 * @PackageName: com.neutech.maplestory.entity
 * @ClassName: Ground
 * @Description:
 * @date 2021/2/1 18:47
 */
public class Ground extends AbstractMapleStoryObject{
//    private static Image[]images = new Image[100];
//    static {
//        for (int i = 0;i < 100;i ++){
//            images[i] = ImageUtil.getImage("ground1" + i);
//        }
//    }
    public Image img;
    public Ground (){}
    public Ground(MapleStoryClient msc, int x, int y,int width,int height){
        this.msc = msc;
        this.x = x;
        this.y = y;
        this.width = width;
        this.height = height;
//        this.img = ImageUtil.getImage("");
//        this.width = img.getWidth(null);
//        this.height = img.getHeight(null);
    }
    public Ground(MapleStoryClient msc, int x, int y,String key){
        this.msc = msc;
        this.x = x;
        this.y = y;
        this.img = ImageUtil.getImage(key);
        this.width = img.getWidth(null);
        this.height = img.getHeight(null);
    }
    @Override
    public void draw(Graphics g) {
//        g.drawRect(x,y,width,height);
        g.drawImage(Ground.this.img,Ground.this.x,Ground.this.y,null);
    }
}


